<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增题目')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-question-add">
            <div class="form-group">
                <label class="col-sm-3 control-label">父id：</label>
                <div class="col-sm-8">
                    <input name="pId" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">分类代码：</label>
                <div class="col-sm-8">
                    <input name="typeCode" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">科目：</label>
                <div class="col-sm-8">
                    <input name="course" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">题目：</label>
                <div class="col-sm-8">
                    <textarea name="questionBody" class="form-control"></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">题目类型：</label>
                <div class="col-sm-8">
                    <select name="questionType" class="form-control m-b" th:with="type=${@dict.getType('question_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">选项：</label>
               <input type="hidden" name="option" id="option">
                <div   class="col-sm-8 optionDir">
                    <input type="text" name="option" class="option form-control" >
                </div>
                <div   class="col-sm-8 optionDir">
                    <input type="text" name="option" class="option form-control" >
                </div>
                <div   class="col-sm-8 optionDir">
                    <input type="text" name="option" class="option form-control" >
                </div>
                <div   class="col-sm-8 optionDir">
                    <input type="text" class="option form-control" >
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">参考答案：</label>
                <div class="col-sm-8">
                    <textarea name="answer" class="form-control"></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">答案解析：</label>
                <div class="col-sm-8">
                    <textarea name="answerAnalysis" class="form-control"></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注1：</label>
                <div class="col-sm-8">
                    <textarea name="remarks1" class="form-control"></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注2：</label>
                <div class="col-sm-8">
                    <textarea name="remarks2" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "easywenku/question"
        $("#form-question-add").validate({
            focusCleanup: true
        });

        function submitHandler() {

           // let val = $(".option").val();
            // $("#option").val(val);

            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-question-add').serialize());
            }
        }
    </script>
</body>
</html>
